-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix tex. #26
base: master
Are you sure you want to change the base?
fix tex. #26
Conversation
Cool, I wondered what the best to do this was. I had a similar thought but never knew if there were any caveats. To finish this, I think we'd need to add KaTeX to this (I've been eyeing that one), either as an explicit script import, or lazy loaded if $$ or $ is present in any of the markdown cells. So that it works out of the box. We'll then get a few math notebooks to test it out. Also, you don't have to sign your code, there's git blame for that :-) |
@@ -183,6 +196,7 @@ var nbv = (function() { | |||
|
|||
dm = d.createElement('pre'); | |||
dm.style.margin = 0; | |||
dm.className = 'illustration-title'; // fixed: some outputs may be customized hidden, by nagexiucai |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this class referring to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, maybe i should comment it?
users can make 'display_data' hidden by using the 'illustration-title' like "display: none;", we konw.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd drop it, let the illustration title be seen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, that is good, i can understand, the "illustration-title" is a temporary thing of mine, styles should be managed elsewhere.
lib/nbv.js
Outdated
// for exsample: render tex by '[kates](https://github.com/Khan/KaTeX) | ||
// var maths = document.getElementsByClassName("math"); | ||
// for(var i=0; i<maths.length; i++) { | ||
// katex.render(maths[i].getAttribute("tex"), maths[i], { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you'll be using this code to implement KaTeX, please use single quotes instead of double quotes, just for consistency sake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, it is my fault.
Yes, "explicit script import, or lazy loaded if $$ or $ is present in any of the markdown cells" is good. |
I'd just <script> a Cloudflare-hosted version of KaTeX (a current stable version, minified) into viewer.html and scaffold.html. Then you can uncomment that piece of code that does the rendering and then we can both test it live! |
something of math, such as formula, in tex are not renderd properly.
and something like description of matplotlib.pyplot's output <matplotlib.figure.Figure at 0xd4f9860> may be customized hidden.